package avicit.bdp.dgs.qa.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2023-07-18
 * @类说明：DataSourceDTO
 * @修改记录：
 * @注意事项：
 * @主要功能：数据源DTO
 */
@ApiModel(value = "QaDataSourceDTO", description = "数据源DTO")
@Table(name = "bdp_dgs_qa_datasource")
public class QaDataSourceDTO extends BaseDTO {
    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 业务ID，包括jobId、ruleId等
     */
    @LogField
    @ApiModelProperty(value = "业务ID")
    @FieldRemark(column = "business_id", field = "businessId", name = "业务ID")
    @Column(name = "business_id")
    private String businessId;

    /**
     * 数据源类型
     */
    @LogField
    @ApiModelProperty(value = "数据源类型")
    @FieldRemark(column = "datasourceType", field = "datasourceType", name = "datasourceType")
    @Column(name = "datasource_type")
    private String datasourceType;
    @Transient
    private String datasourceTypeName;

    /**
     * 数据源ID
     */
    @LogField
    @ApiModelProperty(value = "数据源ID")
    @FieldRemark(column = "datasourceId", field = "datasourceId", name = "datasourceId")
    @Column(name = "datasource_id")
    private String datasourceId;

    /**
     * 数据源名称
     */
    @LogField
    @ApiModelProperty(value = "数据源名称")
    @FieldRemark(column = "datasource_name", field = "datasourceName", name = "数据源名称")
    @Column(name = "datasource_name")
    private String datasourceName;

    /**
     * 库名称
     */
    @LogField
    @ApiModelProperty(value = "库名称")
    @FieldRemark(column = "dbName", field = "dbName", name = "dbName")
    @Column(name = "db_name")
    private String dbName;

    /**
     * 表名称
     */
    @LogField
    @ApiModelProperty(value = "表名称")
    @FieldRemark(column = "tableName", field = "tableName", name = "tableName")
    @Column(name = "table_name")
    private String tableName;

    /**
     * 字段名称
     */
    @LogField
    @ApiModelProperty(value = "字段名称")
    @FieldRemark(column = "field", field = "field", name = "field")
    @Column(name = "field")
    private String field;

    /**
     * 字段类型
     */
    @LogField
    @ApiModelProperty(value = "字段类型")
    @FieldRemark(column = "fieldType", field = "fieldType", name = "字段类型")
    @Column(name = "field_type")
    private String fieldType;

    /**
     * 过滤条件
     */
    @LogField
    @ApiModelProperty(value = "过滤条件")
    @FieldRemark(column = "filter", field = "filter", name = "filter")
    @Column(name = "filter")
    private String filter;

    /**
     * 跨库比对时表的白名单，也即需要比对的表
     */
    @LogField
    @ApiModelProperty(value = "跨库比对时表的白名单")
    @FieldRemark(column = "white_list", field = "whiteList", name = "跨库比对时表的白名单")
    @Column(name = "white_list")
    private String whiteList;

    /**
     * 跨库比对时表的黑名单，也即不需要比对的表
     */
    @LogField
    @ApiModelProperty(value = "跨库比对时表的黑名单")
    @FieldRemark(column = "black_list", field = "blackList", name = "跨库比对时表的黑名单")
    @Column(name = "black_list")
    private String blackList;

    /**
     * 用于接收前端设置的自定义SQL
     */
    @Transient
    private String abnormalSql;

    /**
     * 校验类型，0:单表校验、1:跨表比对、2:跨库比对、3:文件校验、4:单指标校验、5:多指标校验、6:根据数据标准校验
     */
    @Transient
    private Integer measureType;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    public String getDatasourceType() {
        return datasourceType;
    }

    public void setDatasourceType(String datasourceType) {
        this.datasourceType = datasourceType;
    }

    public String getDatasourceTypeName() {
        return datasourceTypeName;
    }

    public void setDatasourceTypeName(String datasourceTypeName) {
        this.datasourceTypeName = datasourceTypeName;
    }

    public String getDatasourceId() {
        return datasourceId;
    }

    public void setDatasourceId(String datasourceId) {
        this.datasourceId = datasourceId;
    }

    public String getDatasourceName() {
        return datasourceName;
    }

    public void setDatasourceName(String datasourceName) {
        this.datasourceName = datasourceName;
    }

    public String getDbName() {
        return dbName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public String getFilter() {
        return filter;
    }

    public void setFilter(String filter) {
        this.filter = filter;
    }

    public String getWhiteList() {
        return whiteList;
    }

    public void setWhiteList(String whiteList) {
        this.whiteList = whiteList;
    }

    public String getBlackList() {
        return blackList;
    }

    public void setBlackList(String blackList) {
        this.blackList = blackList;
    }

    public String getAbnormalSql() {
        return abnormalSql;
    }

    public void setAbnormalSql(String abnormalSql) {
        this.abnormalSql = abnormalSql;
    }

    public Integer getMeasureType() {
        return measureType;
    }

    public void setMeasureType(Integer measureType) {
        this.measureType = measureType;
    }
}
